<?php
/**
 * Copyright (c) 2008 Pascal MARTIN <contact@pascal-martin.fr>,
 *                    Rémi PERROUD <remi.perroud@gmail.com>
 *      http://code.google.com/p/simpleguestbook/
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * 
 * @author Pascal MARTIN
 * @version $Id: main.phtml 15 2008-09-24 22:14:56Z pascal.martin.pmn $
 * 
 */

require_once(dirname(__FILE__).'/../src/CommentsManager.php');

$commentsManager = new CommentsManager();
$comments = $commentsManager->listAll();

?>
<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
	    <title>Guestbook</title>
	</head>
	
	<body id="guestbook-body">
	
		<div id="layout-header">
		    
		    <div id="layout-header-title">
		    GuestBook - No Framework
			</div>
		
			<div id="layout-header-welcome">
			    Bienvenue, <a id="login" href="/admin/login">Connexion</a>
			</div>
		
			<div id="layout-header-end"></div>
			
		</div>
		
		<div id="layout-middle">
		    
		    <div id="layout-menu">
			</div>
		    
		    <div id="layout-content">
		        <div id="layout-cdf"></div>
		        
		        <?php
		        
		        foreach($comments as $c)
		        { 
		        ?>
		        <div class="comment" id="comment-<?php print $c['id']; ?>">
		
			    <div class="comment-header">
			                Posté par <span class="comment-login"><?php print $c['id_user']; ?></span>,
			        le <span class="comment-date"><?php print $c['date']; ?></span> :
			    </div>
			    
			    <div class="comment-text">    
			        <?php print $c['texte']; ?> 
				</div>
				
				<?php
				}
				?>

				
			</div>
		    
		</div>
		
		<div id="layout-footer">
		  
		
		</div>
		
		<div id="layout-debug">
		</div>
		
	</body>

</html>

        